<template>
    <div class="mui-numbox" data-numbox-min='1'>
			<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
			<input id="test" class="mui-input-numbox" type="number" ref="el" :value="num"  @change="setTotal"/>
			<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
	</div>
</template>
<script>
import mui from '../../../lib/js/mui.min.js'
import {mapMutations} from 'vuex'
export default {
	data(){
		return {
		}
	},
	watch:{

	}, 
	created(){
		
	},
	methods: {
         ...mapMutations(["setNumber"]),
		 setTotal(){
            var n=parseInt(this.$refs.el.value);
            
             this.setNumber({
                 id:this.id,
                 numb:n
             });
         }
	 },	 
	mounted(){
        mui(".mui-numbox").numbox();	
        mui(".mui-numbox").numbox().setOption("max",this.max);
	},	
    props:["max",'num','id'],
    
}
</script>
<style scoped>


</style>